<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>07_BOM操作</title>
</head>
<body>
    <button onclick="alert('警告框')">弹出警告框</button>
    <button onclick="confirm('您确认要删除吗?')">弹出确认框</button>

    <script>
        //将参数以舍弃小数部分的方式转为整数
        console.log(parseInt(6.6));
        console.log(parseInt(6.1));
        console.log(parseInt(6));
        console.log(parseInt('hhhh'));//NaN
        //将参数转为小数
        console.log(parseFloat(6.6));//6.6
        console.log(parseFloat(5));//5
        console.log(parseFloat('5.3'));//5.3
        console.log(parseFloat('hhhh'));//NaN

        //判断参数是否为非数字,如果是非数字,结果为true
        console.log(isNaN('hhhh'));//true
        console.log(isNaN(6));//false
        console.log(isNaN(6.9));//false
    </script>
</body>
</html>